/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package controler;


import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import view.ToolboxPanel;
/**
 *
 * @author Tomek
 */
public class ToolboxControler {
    private Controler controler;
    private ToolboxPanel tPanel;
    private NodeItemControler nodeItemControler;
    private EdgeItemControler edgeItemControler;

    public ToolboxControler(Controler c){
        controler = c;
        tPanel = new ToolboxPanel();
        nodeItemControler = new NodeItemControler(c);
        edgeItemControler = new EdgeItemControler(c);
        tPanel.setNodeView(nodeItemControler.getView());
        tPanel.setEdgeView(edgeItemControler.getView());
        initActions();
    }


    public ToolboxPanel getView(){
        return tPanel;
    }

    public void initActions(){

    }

    public void redEdge(){
        edgeItemControler.getView().setToolboxColor(Color.red);
        edgeItemControler.getView().repaint();
    }

    public void blackEdge(){
        edgeItemControler.getView().setToolboxColor(Color.black);
        edgeItemControler.getView().repaint();
    }

    public void redNode(){
        nodeItemControler.getView().setToolboxColor(Color.red);
        nodeItemControler.getView().repaint();
    }

    public void blackNode(){
        nodeItemControler.getView().setToolboxColor(Color.black);
        nodeItemControler.getView().repaint();
    }





}
